#pragma once


class C2DRender: public I2DRender, public IRenderObjectBase
{
public:
	C2DRender();

	//	I2DRender
	virtual void Set2DMode(float width, float height);
	virtual void DrawQuad(float x, float y, float width, float height, const Color& color);

	virtual void Flush();
	//	---

private:
	bool IsInsideScreen(float x, float y) const;
	void AddVertex(float x, float y, Color color);
	void ResizeBuffers(uint vertex_count);

private:
	std::unique_ptr<IVertexBuffer>	m_pVertexBuffer;
	std::unique_ptr<IIndexBuffer>		m_pIndexBuffer;

	float m_width;
	float m_height;

	std::vector<S2DVertex> m_vertices;
};